/*密码修改*/

function userPassWordUpdate() {
	var s = new Array();
	if ($("#oldpassword").val() == '') {
		s.push("旧密码不能为空！");
	}
	if ($("#newpassword").val() == '') {
		s.push("新密码不能为空！");
	}
	if ($("#againpassword").val() == '') {
		s.push("确认密码不能为空！");
	}
	if ($("#againpassword").val() != $("#newpassword").val()) {
		s.push("两次输入的密码不一致!");
	}
	if ($("#oldpassword").val() == $("#newpassword").val()) {
		s.push("新密码与旧密码不能一样！");
	}
	if ($("#againpassword").val() == $("#newpassword").val()
			&& $("#againpassword").val() != '') {
		/*if (!testPass($("#newpassword").val())) {
			s.push("密码长度为6到20之间:");
			s.push("必须含有小写字母、大写字母、数字、特殊符号中的任意三种");
		}*/
	}

	if (s.length > 0) {
		jalerts(s);
		return false;
	}

	/*var oldpassword = strEnc($("#oldpassword").val());
	var newpassword = strEnc($("#newpassword").val());
	var againpassword = strEnc($("#againpassword").val());*/
	var oldpassword = $("#oldpassword").val();
	var newpassword = $("#newpassword").val();
	var againpassword = $("#againpassword").val();
	$.ajax({
		url : ctp + "/pubController/pwdUpdate.shtml",
		data : {
			oldpassword : oldpassword,
			newpassword : newpassword,
			againpassword : againpassword
		},
		type : 'POST',
		async : false,
		dataType : 'json',
		success : function(result) {
			if (result.success) {
				jalert9(result.msg);
				setTimeout(function(){
					back();
				},WARN_TIME_OUT);
			} else {
				jalert9(result.msg);
			}
		}
	});
}
function back() {
	parent.closeDialogWin();
}
